<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta content="width=device-width,initial-scale=1,maximum-scale=1" name="viewport">
    <meta content="telephone=no,email=no,address=no" name="format-detection">
    <meta content="on" http-equiv="x-dns-prefetch-control">
    <meta name="renderer" content="webkit" />
    <meta name="keyword" content="" />
    <meta name="description" content="" />
    <title>虚拟货币</title>
    <link rel="stylesheet" href="../../../static/css/reset.css">
    <link rel="stylesheet" href="../../../static/vendor/toastify/toastify.min.css">
    <link rel="stylesheet" href="../../../static/css/main.css">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="../../../static/vendor/html5shiv.min.js"></script>
    <script src="../../../static/vendor/respond.min.js"></script>
    <script>
        alert("您的浏览器版本过低请升级！");
        location.href = "http://outdatedbrowser.com/zh-cn";
    </script>
    <![endif]-->
</head>
<body class="model-body">
<div id="app">
    <div class="model-page">
        <form id="add-address">
            <div class="model-form">
                <div class="model-form-item">
                    <div class="item-label">
                        提现地址：
                    </div>
                    <div class="item-control">
                        <input name="withdraw_address" type="text" class="model-text" />
                    </div>
                </div>
                <div class="model-form-item">
                    <div class="item-label">
                        备注：
                    </div>
                    <div class="item-control">
                        <input name="remark" type="text" class="model-text" />
                    </div>
                </div>
                <div class="model-form-item">
                    <div class="item-label">
                        交易密码：
                    </div>
                    <div class="item-control">
                        <input name="deal_password" type="text" class="model-text" />
                    </div>
                </div>
                <div class="model-form-item">
                    <div class="item-label">
                        短信验证码：
                    </div>
                    <div class="item-control">
                        <input name="code" type="text" class="model-text model-text-special" />
                        <button class="get-code get-new-code">获取验证码</button>
                    </div>
                </div>
                <div class="model-form-item">
                    <div class="item-control">
                        <input type="submit" value="确认" class="model-btn submit-btn">
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<script src="../../../static/vendor/jquery.min.js"></script>
<script src="../../../static/vendor/layer/layer.js"></script>
<script src="../../../static/vendor/jquery.validate/jquery.validate.min.js"></script>
<script src="../../../static/vendor/jquery.validate/jquery.validate.extend.js"></script>
<script src="../../../static/vendor/toastify/toastify-js.js"></script>
<script src="../../../static/vendor/vue.min.js"></script>
<script src="../../../static/vendor/vue-i18n.min.js"></script>
<script src="../../../static/js/main.js"></script>
<script>

    $(function(){

        $(".submit-btn").on("click",function(){
            $("#add-address").validate({
                rules: {
                    withdraw_address: {
                        required: true
                    },
                    remark: {
                        required: true
                    },
                    deal_password: {
                        required: true
                    },
                    code: {
                        required: true,
                        codeVal:true
                    }
                },
                messages: {
                    withdraw_address: {
                        required:"提现地址不能为空"
                    },
                    remark: "备注不能为空",
                    deal_password: "交易密码不能为空",
                    code: "请输入有效的验证码"
                },
                submitHandler:function(form){
                    myToast("在这里提交~",'info');
                }
            })
        });


        $(".get-old-code").on("click",function(){
            $("#edit-bind-phone").validate({
                rules: {
                    old_phone: {
                        required: true,
                        phone: true
                    }
                },
                messages: {
                    old_phone: "请输入一个正确的手机号码"
                },
                debug:true,
                submitHandler:function(form){
                    getCode(".get-old-code",120)
                }
            })
        })


        $(".get-new-code").on("click",function(){
            $("#edit-bind-phone").validate({
                rules: {
                    new_phone: {
                        required: true,
                        phone: true
                    }
                },
                messages: {
                    new_phone: "请输入一个正确的手机号码"
                },
                debug:true,
                submitHandler:function(form){
                    getCode(".get-new-code",120)
                }
            })
        })

    })

</script>
</body>
</html>